package beast;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import junit.framework.TestCase;
import beast.evolution.alignment.Alignment;
import beast.evolution.alignment.Alignment2;
import beast.evolution.alignment.AscertainedAlignment;
import beast.evolution.alignment.Sequence;
import beast.evolution.tree.Tree;
import beast.util.TreeParser;

public class BEASTTestCase extends TestCase {
	public static final double PRECISION = 1e-6;

	public Alignment getFourTaxaNoData() throws Exception {
		Sequence a = new Sequence("A", "A");
		Sequence b = new Sequence("B", "A");
		Sequence c = new Sequence("C", "A");
		Sequence d = new Sequence("D", "A");

		Alignment data = new Alignment();
		data.initByName("sequence", a, "sequence", b, "sequence", c,
				"sequence", d, "dataType", "nucleotide");
		return data;
	}

	static public Tree getTree(Alignment data, String tree) throws Exception {
		TreeParser t = new TreeParser();
		t.initByName("taxa", data, "newick", tree);
		return t;
	}

	static public Alignment2 getAlignment() throws Exception {
		Sequence human = new Sequence(
				"human",
				"AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTA");
		Sequence chimp = new Sequence(
				"chimp",
				"AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA");
		Sequence bonobo = new Sequence(
				"bonobo",
				"AGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTA");
		Sequence gorilla = new Sequence(
				"gorilla",
				"AGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTA");
		Sequence orangutan = new Sequence(
				"orangutan",
				"AGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA");
		Sequence siamang = new Sequence(
				"siamang",
				"AGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTA");

		List<Sequence> seq_list = Arrays.asList(human, chimp, bonobo, gorilla,
				orangutan, siamang);
		Alignment2 data = new Alignment2(seq_list, 4, "nucleotide");
		// data.initByName("sequence", human, "sequence", chimp, "sequence",
		// bonobo, "sequence", gorilla, "sequence", orangutan, "sequence",
		// siamang, "dataType", "nucleotide");
		return data;
	}

	static public Sequence German_ST;
	static public Sequence Dutch_List;
	static public Sequence English_ST;
	static public Sequence French;
	static public Sequence Italian;
	static public Sequence Spanish;

	static {
		try {
			German_ST = new Sequence(
					"German_ST",
					"              1000000010000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000000000001000000000000000000000000000000010000000000000000000001000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000001000000000000000000100000000000000000000000000000010000000000000000000000010000000000000000000010000000000000000000000010000000???????????????????100000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000100000000000000000000000000000010000000000000000000000010000000000000000000000000000010000000000000000000000001000000000000000000000000000000000010000000000000100000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000001000000000000000001000000000000100000000000000001000000000000000000000000000000000100000000000000000000000000000100001000000000000000000000000000000100000000000000001000000000000000100000000001000000000000000000000000000000001000000000000000001000000000000000000000000000000000001000000000000000000001000000000000000001000000000000100000000000000000000000000000000000100000000000000000000000000000000000000000010000100000000000000000000000100000000010000000010000000000000000000000010000000000000000000000100000000000010000000000000000000000000000010000000000000000000000100000000000000000101000000000000000000000000000000000000000000000010000010000000000010000000000000000000000000000000000100000000000000000000001000000000000000000001000000000010000000000000000000000000010000000000000000000000000000000001000000000000001000000000000000001000000000000000000001000000000000000000000100000000000000001000000000000000000000000100000000000000000000000000000000000000000000000000001100000000000000000000000000000010000000000000000000000000000000001000000000100000000010000000000000000000000010000000000000000001000000000000000000000000010000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000010000000000000001000000000000010000000000000000100000000000000000000100000000000000010000000000000000010000000000000000000000000000100000000000000000000000000100000000000000000000000000000000000000100000000000001000000000000000000000010000000000000010000000000000000100000000000000000100000000000000000000000000000000000000000100000000000000???????????1000000000010000000000000000000000001000000000000000000010000100000000000000000000100000000000000000000000000000000000000000000000000100000000010000000000000000000000010000001000001000000000000001000001000000000000000001000001000000000000000100000000000000000000000000000000000000010000000000000000000000000000000000000100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000001000000000000000000001000000000000000000000000000000010000000000000000000000000000000000010000000100000000000001000000000000000000000000000000100000000000000000000000000000000000001000000000000000000000000001000000000000000000000000000000000000010000000000000000000000000000010000000010000000000000000000000010000000000000000000000000000000000000000100000000000000000000000000000010000001000000000010000000000000000000000010000000000000000100000000000000100000000000000000000000010000000000000000000000001000000000000000000000100000000000000001000000000000000000010000000000000000000000010000000000000000000100000000000000000000000000000000000010000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000010000000000000000000100000000000000000000000000000000000010000000000000000000000000000000000000010000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000001000000000000000000000000010000000001000000000000000000000000000000000000000000000000001000000000000000000000000000000000000100000000000000000100000000000000000000000001000000001000000000000000000000000000001000000000000000000000000000000000000001000000000000000000000000010000100000000000000000001000000000000000000000000000001000000000000000000000001000000000000000000000000000001000000000000000000000000000100000000000000000000000000000000010000000000000000001000001010000000000000000000000000000000000000000000000000100000000000000000000000000001000000010000000001000000000000000000000000000000000000000000000010000000000000000101000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000000000010000000000000000000000000000010000000000010001000000000000000000000000000000100001000000001000000000000000010000000000000000000000001000000000000000100000000000000000000000000010100000000000000000001000000000000000010000000000000000000000000000000000000000100000000000000000000000010000000000000000000000000001000001000000000000000000000000000000100000000000000001000000000000000000000000010000000000000000000010000000000000000000001000000000000");
			Dutch_List = new Sequence(
					"Dutch_List",
					"          1000000010000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000001000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000100000000000000000010000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000001000000000000000000100000000000000000000000000000010000000000000000000000010000000000000000100010000000000000000001000000000000???????????????????1000000000000000000000001000000000000000000000010000000000000000000000000000000000000000000001000000000000000000000000000000100000000000000000000000100000000000000000000000000000000000000000001000000000010000000000000000000000000000000000100000000000001000000000000000000000001000000000000000000010000000000000000000000000000000000000000000000000000000010000000000000000010000000000001000000000000000010000000000000000000000000000000001000000000000000000000000000001000010000000000000000000000000000001000000000000000010000000000000001000000000010000000000000000000000000001000000000000000000000010000000000000000000000000000000000010000000000000100000000000000000000000010000000000001000000000000000000000000000001000000000000000000000000000000000000000000000000100001000000000000000000000001000000000110000000000000000000000000000000100000100000000000000001000000000000100000000000000000000010000000100000000000000000000001000000000000000001010000000000000000000000000000000000000000000000??????10000000000010000000000000000000000000000000000100000000000000000000001000000000000000000001000000000000000000000000000000000000010000000000000000000000000000000001000000000100000000000000000000001000000000000000000001000000000000000000000100000000000000001000000000000000000000000100000000000000000000000000000000010000000000000100000000000000000000000000000000000010000000000000000000000000000000001000000000100000000010000000000000000000000000000000000000000001000000000000000000000000010000000000000000000000100000000000000000000000000000000000000011000001011000000000000000000000000110000000000000001000000000000010000000000010000000000000000000000000100000000000000010000000000000000010000000000000000000000000000100000000000001000000000000100000000000000000000000000000000000000100000000000001000000000000000000000010000000000000010000000000000000100000000000000000100000000000000000000000000000000000000000100000000000000???????????100000000001000000000000000000000000100000000000000000001000010000000010000000000010000000000000000000000000000000000000000000000000010000000001000000000000000000000001000000100000100000000000000100000100000000000000000100000100000000000100010000000000000000000000000000000000000001000000000000000000000000000001000000000000000000000000000000000000000000001000001000000000000000000000000000000000100000000000000000000000000100000000000000000000100000000000000000000000000000001000000000000000000000000000000000000000000010000000000000000000000000000000000000000000010000000000000000010000000000000000000000000000000000000100000000000000000000000000000000000000000000001000000000000000000000000000001000000001000000000000000000000001000000000000000000000000000000000000000100000000000000000000000000000000000000100000000001000000000000000000000001000000000000000010000000000000010000000000000000000000001000000000000000000000000100000000000000000000010000000000000000000100000000000000001000000000000000000000001000000000000000000010000000000000000000000000000000000001000000000000000000000000000000000010000000000000010000000000000000000000000000000000000000010000000000000000000000100000000000000000000000000110000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000100000000000000000000000001000000000100000000000000000000000000000000000000000000000000100000000000000000000000000001000000000000000000000000010000000000000000000000000100000000100000000000000000000000000000100000000000000000000000000100000000000000000000000000000000000001000000000000000000000000100000000000000000000000000000100000000000000000000000100000000000000000000000000000100000000000000000000000000010000000000000000000000000000000001000000000000000000010000101000000000010000000000000000000000000000000000000010000000000001000000000000000100000001000000000100000000000000000000000000000000000000000000001000000000000000010100000000000000000000000000000000000000000000000000000001000000000000000000001000000000000000000001000000000000000000000000000001000000000001000100000000000000000000000000000010000100000000100000000000000001000000000000000000000000100100000000000000000000000000000000000000001100000000000000000000100000000000000001000000000000000000000010000000000000000000000000000000000000000001000000000000000000000000000100000000000000000000000010000000000000000000000000000100000000000000000000000001000000000000000000001000000000000000000000?????????????");
			English_ST = new Sequence(
					"English_ST",
					"             1000000010000000000000000000000001000000000000000000000000000000000000000000100000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000100000100000000000000000000000000000000000001000000000000000010000000000000000100000000000000000000001000000000000???????????????????0000000000000100000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000010000000000100000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000100000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000010000000000001000000000000000100000000000000000000000000000000000000000000010000000000000000001000010000000000000000000000000000001000000000000000010000000000000001000000000010000000000000000000000000001000000000000000000000010000000000000000000000000000000000010000000000000100000000000000000000000010000000000000000100000000000000000000000001000000000000000000000000000000000000000000000000100001000000000000000000000001000000000100010000000000000000000000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000001000000000000000001010000000000000000000000000000000000000000000000??????1000000000001000000000000000000000000000000000010000000000000000000000100000000000000000000000000000000010000000000000000000000001000000000000000000000000000000000100000000010000000000000000000000100000000000000000000100000000000000000000010000000000000000000000010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000?????????0100000000000000010000000000000000000000000000000000000000100000000000000000000010000000000000000000000000000000000001000000000000000000000000001000000000000000000000000100000000000000000000000001000000000100000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000100000000000001000000000000000000000010000000000000010000000000000000100000000000000000000000100000000000000000000000000000000000000001000000000???????????1000000000000000000000000000000000001000000000000000000010000000000000010000000000100000000000000000000000000000000000000000000000000000000000010000000000000000000000010000001000001000000000000001000001000000000000000001000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000001000000000000000000001000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000010000000010000000000000000000000010000000000000000000000000000000000000000100000000000000000000000000000000000001000000000010000000000000000000000010000000000000000000010000000000100000000000000000000000000100000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000000000010000000000000000000000000100000000000000000000000000000000000000000000000000001000000000000001000000000000000000000000001000000000000000000000000000000000001000000000000001000000000000000000000000001000000000000000000000000000000100000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000010000000001000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000010000000100000000000000000000000001000000001000000000000000000000000000001000000000000000000000000000000000000100000000000000000000000000010000000000000000000000001000000000000000000000000000000000000000000000000000001000000000000000000000000000001000000000000000000000000000100000000000000000000000000000000010000000000000000001000001000000000000000001000000000000000000000000000000000000000100000000000000000000001000000010000000000100000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000100000000000000000000000000000000000000010000000000000000000010000000000000000000000000000010000000000010000000000100000000000000000000000100001000000001000000000000000010000000000000000000000001001000000000000000000000000000100000000000000000000000000000000001000000000000000000000000000000000000000000000000000000001000000000000000000000000000001000000000000000000000000000001000000000000000000000000000001000000000000000001000000000000000000000000010000000000000000000010000000000000000000001000000000000");
			French = new Sequence(
					"French",
					"              10000000001000000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000001000000000000000000000000100000000000000000000000000000000100000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000001000000000000000000100000000000000000000000000000010000000000000000000000001000000000001000000000000000000000000100000000001000000100001000000000000000001000000000000000000000000000100000000000000000010000000000000000000000000000000000000010000000000000000000000000000010000000000000000000010000000000000000000000000000000010000000000000000000000000001000000000000000000000000000001000000001000000000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000001000000000000000000100000000000000010000000000000100000000000000000000000000000000000100000000000000000000000000100000000100000000000000000000000000000010000000000001000000000000000100000000000000000000000000000000000000000000000010000000000000000000100000000000000000000000000001000000000000000100000100000000000000000010000000000000010000000000000000000000000000000000000000000000100000000000000000000000000010000000010000000000000000000100000000010001000000000000000000000000000000010000000000000000000100000000000000010000000000000000000000100000000000000000000000000100000000000000000100000010000000000000000000010000000000000000000010000001000000000000001000000000000000000000000000000000010000000000000000000000010000000000000000000010000000000000000000000000000000000000100000000000000000000000000000001000000001000000000000000000000000000000100000000000000000010000000000000100000000000000000000000000000100000000000100010000000010000000000000000000000000000000000000000000000001000000000000000000000000000100000000000000000000000000001000000000100000000000010000000000000000000000010000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000001000000100000000000000000010000000000000000000000001000000000001000000000000000010000000000000000000000000010000000000010000000000000000000000000001000000000000000000000000100000000000000000000000000000010000000000000000000000000001000000000000000001000000000000000000010000000000000000001000000000000010000000000000000000000010000000000000000000000000000000000000000000010000001000000001000000000000001000000000000000000000000010000000000000010000000000010000000000000000000010000000000000000000000000000000000000000000100000000000000000000000000000000010000001000001000000000000001000000000100000000000001000000010000000000000000100000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000000000000001000000000000000000000000000000001000000000000000000010000000000000000000000001000000000000000000000000100000000000000000000000000000000000000100000000000000000000010000000000000000000000000000000000000000001000000000000000000001000000000000000000001000000000000000000000000010000000010000000000000000000000000001000000000000000000000000000000000000000010000000000000000000000000010000000000000000000100000000000000000000010000000000000000000010000000000000000010000000000000000000100000000000000000000000010000000000000000000100000000000000001000000000000000000000010000000000000000000000100000000000000000000000010000000000000000000000000000000000000000100000000000000000000001000000000000000001000000000000000000000000000000000000000000100000000000000000001000000000000000000010000000000000000000000000000000000000001000000000000000000000000100000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000001000000000000000000000010000000000000000100000000000000000000000000000000000000000000000100000000000000000000000010000000000000000000000000100000000000000000000000001000000000000000000000000000010000000000010000000000000000000000000000100000000000000000000000000000000000110000000000000000000000100000000000000000000000001000000000000000000000000000000000000000000100000000000000000100000000000000000000000001000000000000000000000000000000010010100000000000001000001000000001000000000000000000000000000000000000000000010000000000000000000000000001000000010000000000001000000000000000000000000000000100000000000000000000000000000100001000000000000000000000000000000000010000000000000000000000000000000000000000010000000000000000000000100000000000000000000000000010000000010000000100000000000000000000000000100001000000001000000000000000000000100000000000000000001000000100000000000000000000000000000000000000011000000000000000001000000000000000000001000000000000000000000000000000000000010000000000000000000000000010000000000000000000000000000010000000000000000000100000000000000000000000000001000000000000000000000000000001000000000000000000000100000000000000001000000000000");
			Italian = new Sequence(
					"Italian",
					"             10000000001000000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000001000000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000001000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000001000000000000000000100000000000000000000000000000010000000000000000000000001000000000001000000000000000000000000100000000001100000000001000000000000000001000000000000000000010000000100000000000000000010000000000000000000000000000000000000010000000000000000000000000000010000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000010000000000000000001000000001000000000000000000001000000000000000000000000000001000000000000000000000000000000000000000000000000000001000000000000000000100000000000000000010000000000000000000000010000000000000000000000100000000000000000000000000100000000100000000000000000000000000000010000000000001000000000000000100000000000001000000000000000000000000000000000010000000000000000000100000000000000000000000000001000000000000000001000000000000000000000010000000000000010000000000000000000000000000000000000000000000100000000000000000000000000010000000010000000000000000000100000000010000010000000000000000000000000000010100010000000000000100000000000000010000000000000000000000000010000000000000000000000100000000000000000100000010000000000000000000010000000000000000000010000001000000000000001000000000000000000000000000000000010000000000000000000000010000000000000000000000100000000000000000000000000000000000100000000010000000000000000000001000000001000000000000000000000000000000100000000000000010100000000000000100000000000000000000100000010000000000000100010000000010000000000000000000000000100000000000000001000000000000000000000000000000000100000000000000000000000000001000000000100000000000010000000000000000000000010000000000010000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000001000000000000000000000000000001100000000000000000001010000000001000000000000000010000000000000000000000000010000000000010000000000000000000000010000000000000000000000000000100000000000000000000000100000000000000000000000000000000001000000000000000001000000000000000000010000000000000000001000000000000010000000000000000000001000000000000000000000000000000000000001000000000000???????????1000000000000001000000000000000000000000010000000000000010000000000010000000000000000000000000000000001000000000000000000000000000000100000000000000000000000000000000010000001000001000000000000001000000000100000000000001000000010000000000000000100000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000000100000000000000000000000000000000000000010000000000000000000000001000000000000000000000000000000001000000000000000000000100000000000000000000000000000000100000000000000000000001000000000000000000000000000000100000000000000000000010000000000000000000000000000000000000000000000010000000000000001000000000000000000001000000000000000000000000010000000010001000000000000000000000001000000000000000000000000000000000000000010000000000000000000000000010000000000000000000100000000000000000000010000000000000000000010000000000000001000000000000000000000100000000000000000000000010000000000000000000100000000000000001000000000000000000000010000000000000000000000100000000000000000000000000001000000000000000000000000000100000000100000000000000000000001000000000000000001000000000000010000000000000000000000000000100000000000000000001000000000000000000010000000100000000000000000000000000000100000000000000000000000000100000000000001000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000001000001000000000000000000000000010000000000000000100000000000000000000000000000000000000000000000100000000000000000000000010000000000000000000000000100000000000000000000000001000000000000000000000000000010000000000010000000000000000000000000000100000000000000000000000000000000000110000000000000000000000100000000000000000000000000001000000010000000000000000001000000000000000000000000000000001000000000000000000000001000000000000000000000000000000010010100000000000001000001000000001000000000000000000000000000000000000000000010000000000000000000000000001000000010000000000001000000000000000000000000000000000000000010000000000000000000100001000000000000000000000000000000000000000000000100000000000000000000000000000010000000000000000000000100000000000000000000000000010000000010000000000000000000010000000000000100001000000001000000000000000000000100000000000000000001000000100000000000000000000010000000000000000010000000000000000001000000000000000000001000000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000010000000000000000100000000000000000000000000001000000000000000000000000000001000000000000000000000100000000000000001000000000000");
			Spanish = new Sequence(
					"Spanish",
					"             10000000001000000000000000000000000001000000000000000000000000100000000000000000100000000000000000000000000000000001000000000000000000000000100000000010000000000000000000000100000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000001000000000000000000100000000000000000000000000000010000000000000000000000001000000000001000000000000000000000000100000000000000000000001000000000000000001000000000000000000010010000000000000000000001000000000000000000000000000000000000000010000000000000000000000000000010000000000000000000010000000000000000000000000000000010000000000000000000000001000000000000000000000000000000001000000001000000000000000000001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000001000100000000000000010100000000100000000000000000000000000000000000000100000000000000000000000000100000000100000000000000000000000000001000000000000001000000000000000100000000000001000000000000000000000000000000000001000000000000000000100000000000000000000000000001000000000000000001000000000000000000000010000000000000010000000000000000000000000000000000000000000000100000000000000000000000000010000000010000000000000000000100000000010001000000000000000000000000000000000000010000000000000100000000000000010000000000000000000000000010000000000000000000000100000000000000000100000010000000000000000000010000000000000000000010000001000000000000001000000000000000000000000000000000010000000000000000000000010000000000000000000000100000000000000000000000000000000000100000000010000000000000000000001000000001000000000000000000001000000000000000000000000010000000000000000100000000000000000000100000010000000000000100010000000010000000000000000000000000100000000000000000000000000000000000000000000000000100000000000000000000000000001001000000100000000000010000000000000000000000010000000000010000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000001000000000000000000000100000000000000000000000000000010000000001000000000000000010000000000000000000000000010000000000010000000000000000000000000000000000000100000000010000000000000000000000000000100000000000000000000000000000000001000000000000000001000000000000000000000000100000000000001000000000000010000000000000000000001000000000000000000000000000000000000001000000000000001000000001000000000000001000000000000000000000000010000000000000010000100000010000000000000000000000000000000000000000000000100000000000000100100000000000000000000000000000000010000001000001000000000000001000000000100000000000001000000010000000000000000110000000000000000000000000000000000000001000000000000000000000000000000001000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000000000000001000000000000000000001000000000000100000000000000000010000000000000000000000000010000000000000000000000100000000000000000000000000000000000000100000000000000000000010000000000000000000000000000000000000000001000000000000000000001000000000000000000000000000000000000000000000010000000000000000001000000000000000001000000000000000000000000000000000000000000000000001000000000000000010000000000000000000100000000000000000000010000000000000000000010000000000010000000000000000000000000100000000000000000000000010000000000000000000100000000000000001001000000000000000000010000000000000000000000100000000000000000000010000000000000000000000000000000000100000000000000000000000000000001000000000000000001000000000000000000000000000000000000000000110000000000000000001000000000000000000010000000100000000000000000000000000000100000000000000000000000000100000000000010000000000000000000000000000100100000000000000000000100000000000000000000000000000100000000000000000000000000000000000000000000000000000010000000000000000000010000000000000000000100000000000000000000000000000000000000000000100000000000000000000000010000000000000000000000000000000000010000000000000001000000000000000000000000000010000000000010000000000000000000000000000100000000000001000000000000000000000110000000000000000000000100000000000000000000000001000000000000000000000000000000000000000000100000000000000001000000000000000000000000001000000000000000000000000000000010010100000000000001000001000000001000000000001000000000000000000000000000000000000000000000100000000000001000000010000000000001000000000000000000000000000001000000000010000000000000000000100001000000000000000000000000000001000000000000000100000000000000000000000000000010000000000000000000000100000000000000000000000000010000000010000000100000000000000000000000000100001000000001000000000000000000000100000000000000000001000000001000000000000000000010000000000000000010000000000000000001000000000000000000001000000000000000000000100000000000000000000000000000000000000000100000000000000000000000000001000000000000000000000100000000000000000000000000000000010000000000000000000000001000000000000000000100000000000000000001000000000000");
		} catch (Exception e) {
			// ignore: handle exception
		}
	}

	static public Alignment getBinaryAlignment() throws Exception {
		Alignment data = new Alignment();
		data.initByName("sequence", German_ST, "sequence", Dutch_List,
				"sequence", English_ST, "sequence", French, "sequence",
				Italian, "sequence", Spanish, "dataType", "binary");
		return data;
	}

	static public Alignment getCovarionAlignment() throws Exception {
		Alignment data = new Alignment();
		data.initByName("sequence", German_ST, "sequence", Dutch_List,
				"sequence", English_ST, "sequence", French, "sequence",
				Italian, "sequence", Spanish, "dataType", "twoStateCovarion",
				"strip", true);
		return data;
	}

	static public Alignment getAminoAcidAlignment() throws Exception {
		Sequence Struthio_camelus = new Sequence(
				"Struthio_camelus",
				"VKYPNTNEEGKEVVLPKILSPIGSDGVYSNELANIEYTNVSKAAAAAFATVDDYKPVPLDYMLDSKTSNKNNVVESSGTLRHFGK");
		Sequence Rhea_americana = new Sequence(
				"Rhea_americana",
				"VKYPNTNEEGKEVLLPEILNPVGTDGVYSNELANIEYTNVAKDAAAAFATVDDHKPVSLEYMLDSKTSNKDNVVESNGTLSHFGK");
		Sequence Pterocnemia_pennata = new Sequence(
				"Pterocnemia_pennata",
				"VKYPNTNEEGKEVLLPEILNPVGADGVYSNELANIEYTNVSKDHDEVFATVDDHKPVSLEYMLDSKTSNKDNVVESNGTLSHFGK");
		Alignment data = new Alignment();
		data.initByName("sequence", Struthio_camelus, "sequence",
				Rhea_americana, "sequence", Pterocnemia_pennata, "dataType",
				"aminoacid");
		return data;
	}

	static public AscertainedAlignment getAscertainedAlignment()
			throws Exception {
		// same as getAlignment, but with first four sites the constant sites
		// ACTG
		List<Sequence> sequences = new ArrayList<Sequence>();
		sequences
				.add(new Sequence(
						"human",
						"ACTGAGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGGAGCTTAAACCCCCTTATTTCTACTAGGACTATGAGAATCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTA"));
		sequences
				.add(new Sequence(
						"chimp",
						"ACTGAGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTCAAATCCCCTTATTTCTACTAGGACTATAAGAATCGAACTCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA"));
		sequences
				.add(new Sequence(
						"bonobo",
						"ACTGAGAAATATGTCTGATAAAAGAATTACTTTGATAGAGTAAATAATAGGAGTTTAAATCCCCTTATTTCTACTAGGACTATGAGAGTCGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCGTACTAAGAAATTTAGGTTA"));
		sequences
				.add(new Sequence(
						"gorilla",
						"ACTGAGAAATATGTCTGATAAAAGAGTTACTTTGATAGAGTAAATAATAGAGGTTTAAACCCCCTTATTTCTACTAGGACTATGAGAATTGAACCCATCCCTGAGAATCCAAAATTCTCCGTGCCACCTGTCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTCACATCCTTCCCGTACTAAGAAATTTAGGTTA"));
		sequences
				.add(new Sequence(
						"orangutan",
						"ACTGAGAAATATGTCTGACAAAAGAGTTACTTTGATAGAGTAAAAAATAGAGGTCTAAATCCCCTTATTTCTACTAGGACTATGGGAATTGAACCCACCCCTGAGAATCCAAAATTCTCCGTGCCACCCATCACACCCCATCCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTACACCCTTCCCGTACTAAGAAATTTAGGTTA"));
		sequences
				.add(new Sequence(
						"siamang",
						"ACTGAGAAATACGTCTGACGAAAGAGTTACTTTGATAGAGTAAATAACAGGGGTTTAAATCCCCTTATTTCTACTAGAACCATAGGAGTCGAACCCATCCTTGAGAATCCAAAACTCTCCGTGCCACCCGTCGCACCCTGTTCTAAGTAAGGTCAGCTAAATAAGCTATCGGGCCCATACCCCGAAAATGTTGGTTATACCCTTCCCATACTAAGAAATTTAGGTTA"));
		AscertainedAlignment data = null;
		data = new AscertainedAlignment();
		for (Sequence sequence : sequences) {
			data.m_pSequences.setValue(sequence, data);
		}
		// data.m_nStateCount.setValue(4, data);
		data.m_sDataType.setValue("nucleotide", data);
		data.m_excludefrom.setValue(0, data);
		data.m_excludeto.setValue(4, data);
		data.m_excludeevery.setValue(1, data);
		data.initAndValidate();

		return data;
	}

	static public Tree getTree(Alignment data) throws Exception {
		TreeParser tree = new TreeParser();
		/*
		 * tree .initByName( "taxa", data, "newick",
		 * "((((human:0.024003,(chimp:0.010772,bonobo:0.010772):0.013231):0.012035,gorilla:0.036038):0.033087000000000005,orangutan:0.069125):0.030456999999999998,siamang:0.099582);"
		 * );
		 */
		tree
				.initByName("taxa", data, "newick",
						"((((bonobo:1,gorilla:1):1,chimp:2):2,(orangutan:2,siamang:2):2):0,human:4);");

		return tree;
	}

	static public Tree getAminoAcidTree(Alignment data) throws Exception {
		TreeParser tree = new TreeParser();
		tree
				.initByName(
						"taxa",
						data,
						"newick",
						"(Struthio_camelus:0.09413496891819266,(Rhea_americana:0.03667415617018579,Pterocnemia_pennata:0.03667415617018579):0.05746081274800687);");
		return tree;
	}
}